package com.sikao.app.dao;

import android.content.Context;
import android.graphics.Bitmap;

import com.sikao.app.net.HttpApi;
import com.sikao.app.net.OnNetBackListener;
import com.sikao.app.net.SpotsCallBack;
import com.squareup.okhttp.Response;


/**
 * Created by y50 on 2016/5/24.
 */
public class GraphicCodeModel extends BaseModel {


	public GraphicCodeModel(Context context, OnNetBackListener listener) {
		super(context, listener);
	}


	@Override
	public void request(String data, boolean isShow) {

		get(HttpApi.IMGURL + data, new SpotsCallBack<Bitmap>(context, isShow) {

			@Override
			public void onSuccess(Response response, Bitmap result) {
				onNetBackListener.netBack(result);
			}

			@Override
			public void onError(Response response, int code, Exception e) {
				onNetBackListener.netBack(null);
			}
		});
	}
}